function [flg]=checkIfMethodsDirsExist(sequences,AlgNames)
f1=1;
f2=1;



f2=checkIfDirsExist(sequences);

if(nargin>1)
    f1=checkIfMethodExist(AlgNames);
end

if(f1==1 && f2==1)
    flg=1;
else
    flg=0;
end

end


function [f2]=checkIfDirsExist(sequences)
f2=1;

numsequences=size(sequences,2);
[cdirname] = findCorrectDataDirectory();
if(size(cdirname,2)<2)
    error(' could not find image set directory ');
end
for i=1:numsequences
    if(exist([ cdirname sequences{i}],'dir')==0)
        f2=0;
        error([' could not find data set : ' sequences{i} ' looked into: ' cdirname sequences{i}]);
        break;
    end
    
    if(exist([ cdirname sequences{i} '/' 'matfiles' sequences{i}],'dir')==0)
        display(['sift folder for ' sequences{i} ' doesnt exist']);
    end
end



end


function [f1]=checkIfMethodExist(AlgNames)
f1=1;

numalgs=size(AlgNames,2);

for i=1:numalgs
    if(exist([ AlgNames{i} '.m'],'file')==0)
        f1=0;
        error([' could not find file : ' AlgNames{i} '.m' ' in directory ' pwd ]);
        break;
    end
end

end